'use strict';

/**
 * 出勤记录schema
 */
const mongoose = require('mongoose'), Schema = mongoose.Schema;

const attendanceSchema = new Schema({
    a_mm: {type: String, require: true}, //考勤月份 201709
    u_id: {type: String, require: true}, //用户
    a_dd: [{
        date: Number,
        from: Date,
        to: Date,
        flag: Number
    }], //考勤详情
    c_id: {type: String}, //创建者
    m_id: {type: String}, //更新者
}, {timestamps: {createdAt: 'c_at', updatedAt: 'm_at'}});

module.exports = mongoose.model('AttendanceModel', attendanceSchema, "attendance");
